package com.jams.goodox.utils;

import android.app.ProgressDialog;
import android.content.Context;

import com.jams.goodox.R;

/**
 * Created by jams on 2017/6/1.
 * ***
 * Tel: ***
 */

public class ProgressDialogUtils {
    public static ProgressDialog progressDialog;

    public static void show(Context context, String msg) {
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
        progressDialog = ProgressDialog.show(context, "", msg, true, false);
        progressDialog.show();
    }
    public static void show(Context context) {
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
        progressDialog = ProgressDialog.show(context, "", context.getString(R.string.loading), true, false);
        progressDialog.show();
    }
    public static void dismiss() {
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }
}
